#!/bin/bash

# MCP Server Ant Design 启动脚本
echo "🚀 启动 MCP Server Ant Design..."

# 切换到项目目录
cd /Users/fengdebing/practise/mcp-server-antd

# 检查构建文件是否存在
if [ ! -f "build/index.js" ]; then
    echo "📦 构建文件不存在，正在构建..."
    npm run build
fi

# 启动 MCP Server
echo "✅ MCP Server Ant Design 已启动"
echo "📍 服务器路径: $(pwd)/build/index.js"
echo "🔗 Cursor 配置命令: node $(pwd)/build/index.js"
echo ""
echo "请在 Cursor 设置中添加以下 MCP 配置："
echo ""
echo '{
  "mcp.servers": {
    "mcp-server-antd": {
      "command": "node",
      "args": ["'$(pwd)'/build/index.js"],
      "env": {
        "NODE_ENV": "production"
      }
    }
  }
}'
echo ""

# 启动服务器（用于测试）
node build/index.js